package com.clive.xxweb.service.impl;

import com.clive.xxweb.bean.User;
import com.clive.xxweb.exception.GlobalException;
import com.clive.xxweb.mapper.UserMapper;
import com.clive.xxweb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User findUserAndPass(User user) {
        User u = userMapper.findUserAndPass(user);
        if (u == null) {
            throw new GlobalException("用户名或密码有误");
        }
        return u;
    }
}
